<script language="JavaScript">

// Start AJAX Functions
function createXMLHttpRequest() {

var ua;

if(window.XMLHttpRequest) {
    try {
      ua = new XMLHttpRequest();
    } catch(e) {
      ua = false;
    }
  } else if(window.ActiveXObject) {
    try {
      ua = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
      ua = false;
    }
  }
  return ua;
}

var req = createXMLHttpRequest();

function sendRequest(type, value) 
{
	//alert('value: ' + value);
	if (value !== '') 
	{
	  req.open('get', './inc/ajax.php?type=' + type + '&value=' + value);
	  req.onreadystatechange = handleResponse;
	  req.send(null);
	}
	else 
	{
		document.getElementById('displayIDValidation').innerHTML = '';
	}
}

function handleResponse() 
{
	if(req.readyState == 4)
	{
		var response = req.responseText;
		var update = new Array();
		if(response.indexOf('||' != -1)) 
		{
			update = response.split('||');
			//alert('update length: ' + update.length + ' - response: ' + response);
			if (update.length > 0) 
			{
				document.getElementById('displayIDValidation').innerHTML = update[1];
			}
		}
		// Uncomment to write errors to a error element
		//document.getElementById('error').innerHTML = response;
	}
	//else
	//	alert("loading" + req.readyState);
}
// End AJAX Functions

function removeCharacters( strValue, strMatchPattern ) {
/************************************************
DESCRIPTION: Removes characters from a source string
  based upon matches of the supplied pattern.

PARAMETERS:
  strValue - source string containing number.

RETURNS: String modified with characters
  matching search pattern removed

USAGE:  strNoSpaces = removeCharacters( ' sfdf  dfd',
                                '\s*')
*************************************************/
 var objRegExp =  new RegExp( strMatchPattern, 'gi' );

 //replace passed pattern matches with blanks
  return strValue.replace(objRegExp,'');
}

function DatePosition(dateString,value) {
    var now = new Date();
    var today = new Date(now.getYear(),now.getMonth(),now.getDate());
    var century = parseInt(now.getYear()/100)*100;
		var date = new Date(dateString.substring(6,10),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));

	if(value == 1)
	{
	//alert('date: ' + date);
	//alert('today: ' + today);
  if (Date.parse(date) > Date.parse(today))
	    {
	      alert('Visit date must be less than or equal to todays date.');
	      document.form.txtVisitDate.select();
	      document.form.txtVisitDate.focus();
	    }
	}

	if(value == 2)
	{
  if (Date.parse(date) >= Date.parse(today))
	    {
	      alert('Birth Date must be less than todays date.');
	      document.form.txtDateOfBirth.select();
	      document.form.txtDateOfBirth.focus();
	    }
	}

	if(value == 3)
	{
  if (Date.parse(date) < Date.parse(today))
	    {
	      alert('When Due date must be greater than or equal to todays date.');
	      return -1;
	    }
	}
}

function convertcurrentcy1 (num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}

function convertcurrency (i) {
 var result = parseFloat(i.value)
 if (i.value == 0 || i.value == NULL) {
  result = '0.00'
 }
 else {
  result = result.toFixed(2)
  result = result.toString()
  var decimal_location = result.indexOf(".")
  var decimal_part_length = result.length - decimal_location - 1
  var pad_total = 2 - decimal_part_length
  if (pad_total > 0) {
		for (var counter = 1; counter <= pad_total; counter++) {
        result += "0"
		}
  }
 }
 i.value = result
}

<!--dollar value-->
function parseelement(thisone){
	var prefix="$"
var wd
	if (thisone.value.charAt(0)=="$")
		return thisone
	wd="w"
	var tempnum=thisone.value
	for (i=0;i<tempnum.length;i++){
		if (tempnum.charAt(i)=="."){
			wd="d"
			break
		}
	}
	if (wd=="w")
		thisone.value=tempnum+".00"
	else{
		if (tempnum.charAt(tempnum.length-2)==".") {
			thisone.value=tempnum+"0"
		}
		else {
			tempnum=Math.round(tempnum*100)/100
			thisone.value=tempnum
		}
	}
}

function checknumber(pnum){
	var x=pnum.value
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (anum.test(x))
	{
		testresult=true
	}
	else{
		alert("Please input a valid number!")
		testresult=false
	}
	return (testresult)
}

function checkban(pnum){
	if (document.layers||document.all||document.getElementById)
		return checknumber(pnum)
	else
		return true
}

function null_number(pnum){
	if (pnum.value.length == 0) {
		pnum.value = 0;
	}
}

function checknumberdollar(pnum){
	var x=pnum.value
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (anum.test(x))
	{
		parseelement(pnum)
		testresult=true
	}
	else{
		alert("Please input a valid number!")
		testresult=false
	}
	return (testresult)
}


function checkbandollar(pnum){
	if (document.layers||document.all||document.getElementById)
		return checknumberdollar(pnum)
	else
		return true
}

<!--make the initial alphabet uppercase-->
function changeCase(frmObj) {
	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	tmpStr = frmObj.value.toLowerCase();
	strLen = tmpStr.length;
	if (strLen > 0)  {
		for (index = 0; index < strLen; index++)  {
			if (index == 0)  {
				tmpChar = tmpStr.substring(0,1).toUpperCase();
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			}
			else {
				tmpChar = tmpStr.substring(index, index+1);
				if (tmpChar == " " && index < (strLen-1))  {
					tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
	      }
	    }
		}
	}
	frmObj.value = tmpStr;
}

<!--element focus-->
function putFocus(formInst, elementInst) {
	if (document.forms.length > 0) {
  	document.forms[formInst].elements[elementInst].focus();
  }
}

<!--help provider-------->
function explain(name,output,msg) {
	newwin = window.open('','','top=150,left=150,width=325,height=300');
	if (!newwin.opener)
		newwin.opener = self;
	with (newwin.document)
	{
	open();
	write('<html>');
	write('<body onLoad="document.form.box.focus()" background="./images/10/main.jpg"><form name=form ><font size="2">' + msg + '<br>');
	write('<p>You may enter your ' + name + ' here and it will be copied into the form for you.');
	write('<p><center>' + name + ':  <input type=text name=box size=10 onKeyUp=' + output + '=this.value>');
	write('<p><input type=button value="Click to close when finished" onClick=window.close()>');
	write('</center></form></body></html>');
	close();
  }
}

<!-----------------------Validation OF Date---------------------------------------------------------->
var isNav4 = false, isNav5 = false, isIE4 = false
var strSeperator = "/";
// If you are using any Java validation on the back side you will want to use the / because
// Java date validations do not recognize the dash as a valid date separator.
var vDateType = 3; // Global value for type of date format
//                1 = mm/dd/yyyy
//                2 = yyyy/dd/mm  (Unable to do date check at this time)
//                3 = dd/mm/yyyy
var vYearType = 4; //Set to 2 or 4 for number of digits in the year for Netscape
var vYearLength = 2; // Set to 4 if you want to force the user to enter 4 digits for the year before validating.
var err = 0; // Set the error code to a default of zero
if(navigator.appName == "Netscape") {
if (navigator.appVersion < "5") {
isNav4 = true;
isNav5 = false;
}
else
if (navigator.appVersion > "4") {
isNav4 = false;
isNav5 = true;
   }
}
else {
isIE4 = true;
}

function DateFormat(vDateName, vDateValue, e, dateCheck, dateType) {
vDateType = dateType;
// vDateName = object name
// vDateValue = value in the field being checked
// e = event
// dateCheck
// True  = Verify that the vDateValue is a valid date
// False = Format values being entered into vDateValue only
// vDateType
// 1 = mm/dd/yyyy
// 2 = yyyy/mm/dd
// 3 = dd/mm/yyyy
//Enter a tilde sign for the first number and you can check the variable information.
if (vDateValue == "~") {
alert("AppVersion = "+navigator.appVersion+" \nNav. 4 Version = "+isNav4+" \nNav. 5 Version = "+isNav5+" \nIE Version = "+isIE4+" \nYear Type = "+vYearType+" \nDate Type = "+vDateType+" \nSeparator = "+strSeperator);
vDateName.value = "";
vDateName.focus();
return true;
}
var whichCode = (window.Event) ? e.which : e.keyCode;
// Check to see if a seperator is already present.
// bypass the date if a seperator is present and the length greater than 8
if (vDateValue.length > 8 && isNav4) {
if ((vDateValue.indexOf("-") >= 1) || (vDateValue.indexOf("/") >= 1))
return true;
}
//Eliminate all the ASCII codes that are not valid
var alphaCheck = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-";
if (alphaCheck.indexOf(vDateValue) >= 1) {
if (isNav4) {
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
else {
vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
return false;
   }
}
if (whichCode == 8) //Ignore the Netscape value for backspace. IE has no value
return false;
else {
//Create numeric string values for 0123456789/
//The codes provided include both keyboard and keypad values
var strCheck = '47,48,49,50,51,52,53,54,55,56,57,58,59,95,96,97,98,99,100,101,102,103,104,105';
if (strCheck.indexOf(whichCode) != -1) {
if (isNav4) {
if (((vDateValue.length < 6 && dateCheck) || (vDateValue.length == 7 && dateCheck)) && (vDateValue.length >=1)) {
alert("Invalid Date\nPlease Re-Enter");
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
if (vDateValue.length == 6 && dateCheck) {
var mDay = vDateName.value.substr(2,2);
var mMonth = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)
//Turn a two digit year into a 4 digit year
if (mYear.length == 2 && vYearType == 4) {
var mToday = new Date();
//If the year is greater than 30 years from now use 19, otherwise use 20
var checkYear = mToday.getFullYear() + 30;
var mCheckYear = '20' + mYear;
if (mCheckYear >= checkYear)
mYear = '19' + mYear;
else
mYear = '20' + mYear;
}
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (!dateValid(vDateValueCheck)) {
alert("Invalid Date\nPlease Re-Enter");
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
return true;
}
else {
// Reformat the date for validation and set date type to a 1
if (vDateValue.length >= 8  && dateCheck) {
if (vDateType == 1) // mmddyyyy
{
var mDay = vDateName.value.substr(2,2);
var mMonth = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)
vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
}
if (vDateType == 2) // yyyymmdd
{
var mYear = vDateName.value.substr(0,4)
var mMonth = vDateName.value.substr(4,2);
var mDay = vDateName.value.substr(6,2);
vDateName.value = mYear+strSeperator+mMonth+strSeperator+mDay;
}
if (vDateType == 3) // ddmmyyyy
{
var mMonth = vDateName.value.substr(2,2);
var mDay = vDateName.value.substr(0,2);
var mYear = vDateName.value.substr(4,4)
vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
}
//Create a temporary variable for storing the DateType and change
//the DateType to a 1 for validation.
var vDateTypeTemp = vDateType;
vDateType = 1;
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (!dateValid(vDateValueCheck)) {
alert("Invalid Date\nPlease Re-Enter");
vDateType = vDateTypeTemp;
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
vDateType = vDateTypeTemp;
return true;
}
else {
if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
alert("Invalid Date\nPlease Re-Enter");
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
         }
      }
   }
}
else {
// Non isNav Check
if (((vDateValue.length < 8 && dateCheck) || (vDateValue.length == 9 && dateCheck)) && (vDateValue.length >=1)) {
alert("Invalid Date\nPlease Re-Enter");
vDateName.value = "";
vDateName.focus();
return true;
}
// Reformat date to format that can be validated. mm/dd/yyyy
if (vDateValue.length >= 8 && dateCheck) {
// Additional date formats can be entered here and parsed out to
// a valid date format that the validation routine will recognize.
if (vDateType == 1) // mm/dd/yyyy
{
var mMonth = vDateName.value.substr(0,2);
var mDay = vDateName.value.substr(3,2);
var mYear = vDateName.value.substr(6,4)
}
if (vDateType == 2) // yyyy/mm/dd
{
var mYear = vDateName.value.substr(0,4)
var mMonth = vDateName.value.substr(5,2);
var mDay = vDateName.value.substr(8,2);
}
if (vDateType == 3) // dd/mm/yyyy
{
var mDay = vDateName.value.substr(0,2);
var mMonth = vDateName.value.substr(3,2);
var mYear = vDateName.value.substr(6,4)
}
if (vYearLength == 4) {
if (mYear.length < 4) {
alert("Invalid Date\nPlease Re-Enter");
vDateName.value = "";
vDateName.focus();
return true;
   }
}
// Create temp. variable for storing the current vDateType
var vDateTypeTemp = vDateType;
// Change vDateType to a 1 for standard date format for validation
// Type will be changed back when validation is completed.
vDateType = 1;
// Store reformatted date to new variable for validation.
var vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
if (mYear.length == 2 && vYearType == 4 && dateCheck) {
//Turn a two digit year into a 4 digit year
var mToday = new Date();
//If the year is greater than 30 years from now use 19, otherwise use 20
var checkYear = mToday.getFullYear() + 30;
var mCheckYear = '20' + mYear;
if (mCheckYear >= checkYear)
mYear = '19' + mYear;
else
mYear = '20' + mYear;
vDateValueCheck = mMonth+strSeperator+mDay+strSeperator+mYear;
// Store the new value back to the field.  This function will
// not work with date type of 2 since the year is entered first.
if (vDateTypeTemp == 1) // mm/dd/yyyy
vDateName.value = mMonth+strSeperator+mDay+strSeperator+mYear;
if (vDateTypeTemp == 3) // dd/mm/yyyy
vDateName.value = mDay+strSeperator+mMonth+strSeperator+mYear;
}
if (!dateValid(vDateValueCheck)) {
alert("Invalid Date\nPlease Re-Enter");
vDateType = vDateTypeTemp;
vDateName.value = "";
vDateName.focus();
return true;
}
vDateType = vDateTypeTemp;
return true;
}
else {
if (vDateType == 1) {
if (vDateValue.length == 2) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 5) {
vDateName.value = vDateValue+strSeperator;
   }
}
if (vDateType == 2) {
if (vDateValue.length == 4) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 7) {
vDateName.value = vDateValue+strSeperator;
   }
}
if (vDateType == 3) {
if (vDateValue.length == 2) {
vDateName.value = vDateValue+strSeperator;
}
if (vDateValue.length == 5) {
vDateName.value = vDateValue+strSeperator;
   }
}
return true;
   }
}
if (vDateValue.length == 10&& dateCheck) {
if (!dateValid(vDateName)) {
// Un-comment the next line of code for debugging the dateValid() function error messages
//alert(err);
alert("Invalid Date\nPlease Re-Enter");
vDateName.focus();
vDateName.select();
   }
}
return false;
}
else {
// If the value is not in the string return the string minus the last
// key entered.
if (isNav4) {
vDateName.value = "";
vDateName.focus();
vDateName.select();
return false;
}
else
{
vDateName.value = vDateName.value.substr(0, (vDateValue.length-1));
return false;
         }
      }
   }
}

function dateValid(objName) {
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var booFound = false;
var datefield = objName;
var strSeparatorArray = new Array("-"," ","/",".");
var intElementNr;
// var err = 0;
var strMonthArray = new Array(12);
strMonthArray[0] = "Jan";
strMonthArray[1] = "Feb";
strMonthArray[2] = "Mar";
strMonthArray[3] = "Apr";
strMonthArray[4] = "May";
strMonthArray[5] = "Jun";
strMonthArray[6] = "Jul";
strMonthArray[7] = "Aug";
strMonthArray[8] = "Sep";
strMonthArray[9] = "Oct";
strMonthArray[10] = "Nov";
strMonthArray[11] = "Dec";
//strDate = datefield.value;
strDate = objName;
if (strDate.length < 1) {
return true;
}
for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
strDateArray = strDate.split(strSeparatorArray[intElementNr]);
if (strDateArray.length != 3) {
err = 1;
return false;
}
else {
strDay = strDateArray[0];
strMonth = strDateArray[1];
strYear = strDateArray[2];
}
booFound = true;
   }
}
if (booFound == false) {
if (strDate.length>5) {
strDay = strDate.substr(0, 2);
strMonth = strDate.substr(2, 2);
strYear = strDate.substr(4);
   }
}
//Adjustment for short years entered
if (strYear.length == 2) {
strYear = '20' + strYear;
}
strTemp = strDay;
strDay = strMonth;
strMonth = strTemp;
intday = parseInt(strDay, 10);
if (isNaN(intday)) {
err = 2;
return false;
}
intMonth = parseInt(strMonth, 10);
if (isNaN(intMonth)) {
for (i = 0;i<12;i++) {
if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
intMonth = i+1;
strMonth = strMonthArray[i];
i = 12;
   }
}
if (isNaN(intMonth)) {
err = 3;
return false;
   }
}
intYear = parseInt(strYear, 10);
if (isNaN(intYear)) {
err = 4;
return false;
}
if (intMonth>12 || intMonth<1) {
err = 5;
return false;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
err = 6;
return false;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
err = 7;
return false;
}
if (intMonth == 2) {
if (intday < 1) {
err = 8;
return false;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
err = 9;
return false;
   }
}
else {
if (intday > 28) {
err = 10;
return false;
      }
   }
}
return true;
}

function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}

function checkRadio (theForm, theRadioGroup)
{
	// set var radio_choice to false
	var radio_choice = false;

  // Set target elements
  var theElements = document.forms[theForm].elements[theRadioGroup];

	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < theElements.length; counter++) {
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (radio_form.radio_button[counter].checked) {
			radio_choice = true;
		}
	}

	if (!radio_choice) {
		// If there were no selections made display an alert box
		return (false);
	}
	else {
		return (true);
	}
}

<!----verify if everything has been inputed---->
function verify() {

	<!--re-enable these elements to avoid errors-->
   	document.form.txtChequePayee.disabled = false;
    document.form.txtErAmountRecieptNo.disabled = false;
    document.form.txtReasonChequePayment.disabled = false;
    document.form.txtOtherPaymentType.disabled = false;

	var themessage = "You are required to complete the following fields: \n";
	if (checkToggle('form','cmbSite') == false) {
		themessage = themessage + " - Site Visited\n";
	}
	if (document.form.txtSurname.value=="") {
		themessage = themessage + " - Surname\n";
	}
	if (document.form.txtCurrentAddress.value=="") {
		themessage = themessage + " - Address\n";
	}
	if (document.form.txtCurrentSuburb.value=="") {
		themessage = themessage + " - Suburb\n";
	}
	if (document.form.txtCurrentPostCode.value=="") {
		themessage = themessage + " - Post Code\n";
	}
	if (document.form.txtVisitDate.value=="") {
		themessage = themessage + " - Visit Date\n";
	}
	if (document.form.txtGivenName.value=="") {
		themessage = themessage + " - Given Name\n";
	}
	if (checkToggle('form','referred_internal') == false){
		themessage = themessage + " - Select Yes/No for client referred internally\n";
	}
	if (checkToggle('form','referred_external') == false){
		themessage = themessage + " - Select Yes/No for client referred externally\n";
	}
	if (checkToggle('form','emergencyReliefs[]') == false) {
		themessage = themessage + " - At least 1 reason for seeking assistance\n";
	}
	if (checkToggle('form','actionTaken[]') == false) {
		themessage = themessage + " - At least 1 Action taken associated with ER\n";
	}
	if (document.form.txtInterviewer.value=="") {
		themessage = themessage + " - Interviewer\n";
	}
	if (document.form.txtAdults.value==0 && document.form.txtChildren.value==0) {
		themessage = themessage + " \n Please Note:\n Both Number of Adults and children can't be zero\n";
	}


	if (themessage == "You are required to complete the following fields: \n") {
		document.form.btnSaveForm.disabled=true;
		document.form.btnSaveForm.value='Please wait...';
		document.form.submit();
	}
	else {
		alert(themessage);
		return false;
	}
}

//script to check that atleast one checkbox for reason for seekign assistance has been checked
function checkToggle (theForm,theCheckbox) {
    // Set target elements
    var theElements = document.forms[theForm].elements[theCheckbox];
   // Loop through the elements


   var check = 0;
    for (var count = 0; count < theElements.length; count++)
    {

         if(theElements[count].checked == true)
         {
         	check++;
         }
    }

    if(check >0)
    {
    	return true;
    }
    else
    {
    	return false;
    }
}


function disableassistance(theForm,theCheckbox) {

    var theElements = document.forms[theForm].elements[theCheckbox];

   var check = 0;
    for (var count = 0; count < theElements.length; count++)
    {
    	if(theElements[count].value == '0' || theElements[count].value == '0.00')
    	{
       		//theElements[count].disabled = true;
       		//check =0;
    	}
    	else
    	{
    		//alert(' Please make sure that dollar amounts for all types of assistance is zero');
    		check ++;
    	}
    }

    if(check > 0)
    {
    	alert(' Please make sure that dollar amounts for all types of assistance is zero');
    }
    else
    {
    	for (var count = 0; count < theElements.length; count++)
    	{
    		theElements[count].disabled = true;
    	}

		document.form.txtChequePayee.value = "no value";
    	document.form.txtErAmountRecieptNo.value = "no value";
    	document.form.txtReasonChequePayment.value = "no value";
    	document.form.txtOtherPaymentType.value = "no value";

    	document.form.txtChequePayee.disabled = true;
    	document.form.txtErAmountRecieptNo.disabled = true;
    	document.form.txtReasonChequePayment.disabled = true;
    	document.form.txtOtherPaymentType.disabled = true;
    }

}


function enableassistance(theForm,theCheckbox) {
    // Set target elements
    var theElements = document.forms[theForm].elements[theCheckbox];
   // Loop through the elements


   var check = 0;


    for (var count = 0; count < theElements.length; count++)
    {

       theElements[count].disabled = false;


    }
   	  document.form.txtChequePayee.disabled = false;
    	document.form.txtErAmountRecieptNo.disabled = false;
    	document.form.txtReasonChequePayment.disabled = false;
    	document.form.txtOtherPaymentType.disabled = false;

}

<!------ to remove the white spaces------>
function remove_XS_whitespace(item)
{
 item.value = item.value.replace(/\r/g, " ");
  item.value = item.value.replace(/[^ A-Za-z0-9`~!@#\$%\^&\*\(\)-_=\+\\\|\]\[\}\{'";:\?\/\.>,<]/g, "");
  //item.value = item.value.replace(/'/g, "");
  item.value = item.value.replace(/ +/g, " ");
  item.value = item.value.replace(/^\s/g, "");
  item.value = item.value.replace(/\s$/g, "");
  if (item.value == ' '){item.value = ''};
}

<!----checks if only aplhabets are included in fields such as name-->
function checkalpha(item)
{
var i=0;
for(i=0;i<=item.length-1;i++)
{
	if(!isAlpha(item.substring(i,i+1)))
	{
	alert('only aphabets please');
	return false;
	}
	else
	{
	return true;
	}
}

}

<!---- the following scripts is for acquiring the other types of different combo boxes.---->
function otherhousingtype(sel)
{
	option=document.form.cmbHousingType.options[document.form.cmbHousingType.selectedIndex].text;
	txt=option;

	if(txt == 'Other')
	{
		message='Enter Other Housing type here';
		document.form.txtOtherHousingType.value=message;
		document.form.txtOtherHousingType.select();
		document.form.txtOtherHousingType.focus();
	}
	else
	{
		document.form.txtOtherHousingType.value="";
		document.form.cmbHousingType.focus();
	}
}

function otherhousingtypenull(sel)
{

	option=document.form.cmbHousingType.options[document.form.cmbHousingType.selectedIndex].text;
	txt=option;
	option1=document.form.txtOtherHousingType.value;
	txt1=option1;

	if(txt == 'Other' && txt1 == "Enter Other Housing type here")
	{
		if(!confirm('Are you sure NOT to enter other Housing type?'))
		{
			document.form.txtOtherHousingType.select();
			document.form.txtOtherHousingType.focus();
		}
		else
		{
			document.form.txtOtherHousingType.value="";

		}
	}
}

function otherincomestatus(sel)
{
	option=document.form.cmbIncomeStatus.options[document.form.cmbIncomeStatus.selectedIndex].text;
	txt=option;

	if(txt == 'Other')
	{
		message='Enter Other Income Status type here';
		document.form.txtOtherIncomeStatusType.value=message;
		document.form.txtOtherIncomeStatusType.select();
		document.form.txtOtherIncomeStatusType.focus();
	}
	else
	{
		document.form.txtOtherIncomeStatusType.value="";
		document.form.cmbIncomeStatus.focus();
	}

}

function otherincomestatusnull(sel)
{
	option=document.form.cmbIncomeStatus.options[document.form.cmbIncomeStatus.selectedIndex].text;
	txt=option;
	option1=document.form.txtOtherIncomeStatusType.value;
	txt1=option1;

	if(txt == 'Other' && txt1 == "Enter Other Income Status type here")
	{
		if(!confirm('Are you sure NOT to enter other Income type?'))
		{
			document.form.txtOtherIncomeStatusType.select();
			document.form.txtOtherIncomeStatusType.focus();
		}
		else
		{
			document.form.txtOtherIncomeStatusType.value="";

		}
	}
	else
	{

	}

}

function otheridtype(sel)
{
	option=document.form.cmbIdType.options[document.form.cmbIdType.selectedIndex].text;
	txt=option;

	if(txt == 'Other')
	{
		message='Enter Other ID type here';
		document.form.txtOtherIdType.value=message;
		document.form.txtOtherIdType.select();
		document.form.txtOtherIdType.focus();
	}
	else
	{
		document.form.txtOtherIdType.value="";
		document.form.cmbIdType.focus();
	}

}

function otheridtypenull(sel)
{
	option=document.form.cmbIdType.options[document.form.cmbIdType.selectedIndex].text;
	txt=option;
	option1=document.form.txtOtherIdType.value;
	txt1=option1;

	if(txt == 'Other' && txt1 == "Enter Other ID type here")
	{
		if(!confirm('Are you sure NOT to enter other ID type?'))
		{
			document.form.txtOtherIdType.select();
			document.form.txtOtherIdType.focus();
		}
		else
		{
			document.form.txtOtherIdType.value="";
			document.form.txtNumber.focus();
		}
	}
	else
	{

	}

}

function chequenumber(sel)
{
	option=document.form.txtChequePayee.value;
	txt=option;

	if(txt == "")
	{

	}
	else
	{
		message='Enter Check Number here';
		document.form.txtErAmountRecieptNo.value=message;
		document.form.txtErAmountRecieptNo.select();
		document.form.txtErAmountRecieptNo.focus();
	}

}

function checkvalue(sel)
{
	option=document.form.txtErAmountRecieptNo.value;
	txt1=option;

	option=document.form.txtChequePayee.value;
	txt2=option;

	if(txt1 == "Enter Check Number here" && txt2 != "")
	{
		message='Enter Check Number here';
		document.form.txtErAmountRecieptNo.value=message;
		document.form.txtErAmountRecieptNo.select();
		document.form.txtErAmountRecieptNo.focus();
	}
	else
	{
		//document.form.txtErAmountRecieptNo.value="";
	}
}

function checkpayee(sel)
{
	option=document.form.txtErAmountRecieptNo.value;
	txt1=option;

	option=document.form.txtChequePayee.value;
	txt2=option;

	if(txt2 == "")
	{
		message='Please Enter Check Payee and Number';
		document.form.txtErAmountRecieptNo.value="";

		document.form.txtChequePayee.focus();
		alert(message);
		document.form.txtChequePayee.focus();
		return false;
	}
}

function checknull(sel)
{
	option=document.form.txtFortnightlyPayments.value;
	txt1=option;


	if(txt1 == null )
	{
		message="0"
		document.form.txtFortnightlyPayments.value=message;
	}
	else
	{
		document.form.txtFortnightlyPayments.value="";

	}

}
</script>

<form name=form method="POST" action="?page=submit_client_add" onsubmit="javascript: return verify();">
<h1>Add Client</h1>
All required fields are marked with by the <img src="images/required.gif" alt="required field" /> icon.
<span id="error"></span>
<img src="questionmark.gif" align="right" onclick="javascript:window.open('addclienthelp.html')">
<hr>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
		<tr><td><h3>Client Details</h3></tr></td>
 		<tr>
    <td width="17%">Site Visited: <img src="images/required.gif" alt="required field" /></td>
    <td width="33%">
    <?
		//populateDropDownListBoxes("er_site",1);
		$query="SELECT * FROM er_site ORDER BY site_name" ;
		$results=r_db($query);
		while ($row=mysql_fetch_array($results))
		{
			echo "<label for=\"$row[1]\" style=\"padding-right:10px;\">$row[1]<input type=\"radio\" name=\"cmbSite\" value=\"$row[0]\" id=\"$row[1]\" /></label>";
		}
		?>
    </td>

    <? $currentDate = date("d/m/Y")?>
    <? $realDate = date("Y-m-d")?>
    <td width="17%">Visit Date: <img src="images/required.gif" alt="required field" /></td>
    <?
    echo"<td width=\"33%\"><input type=\"text\" name=\"txtVisitDate\" value=\"$currentDate\"  size='10' maxlength='10'  onKeyUp=\"DateFormat(this,this.value,event,false,'3')\" onBlur=\"DateFormat(this,this.value,event,true,'3');DatePosition(this.value,1)\">";
    echo"<input type=\"hidden\" name=\"first_visit\" value=\"$realDate\">";
    ?> DD/MM/YYYY
    </td>
  </tr>
	<tr>
		<td>ID Number:</td>
		<td><input type="text" id="id" name="txtNumber" size="20" maxlength="30" onChange="this.value=(removeCharacters(this.value,'[^a-zA-Z0-9]')); sendRequest('id',document.getElementById('id').value);"></td>
		<td colspan="2">
			<span id="displayIDValidation" class="validationMessage"></span>
		</td>
	<tr>
<?
echo "<tr>";
echo "<td >ID Type:</td>
    <td><select size=\"1\" name=\"cmbIdType\" onchange=\"otheridtype(this)\">";
populateDropDownListBoxes("er_identification_type",1, "identification_type");
echo "</select></td>";
?>
 <td >
    Other ID Type:
    </td>
    <td colspan="3">
    <input type="text" name="txtOtherIdType"  size="20" maxlength="30" onchange="return changeCase(this)" onblur="otheridtypenull(this)">

    </td>
	</tr>
  <tr>
    <td>Surname: <img src="images/required.gif" alt="required field" /></td>
    <td><input type="text" name="txtSurname" size="20" maxlength="50" onchange="changeCase(this);" onblur="remove_XS_whitespace(this)" onkeyup="checkalpha(this)" >

    </td>
    <td>Given Name: <img src="images/required.gif" alt="required field" /></td>
    <td><input type="text" name="txtGivenName" size="20" maxlength="50" onblur="changeCase(this)" onchange="remove_XS_whitespace(this)">

    </td>
  </tr>

   <tr>
    <td ><span lang="en-au">Address: <img src="images/required.gif" alt="required field" /></span></td>
    <td><input type="text" name="txtCurrentAddress" style="width:90%" maxlength="100" onblur="changeCase(this)" onchange="remove_XS_whitespace(this)"></td>
    <td>Suburb: <img src="images/required.gif" alt="required field" /></span></td>
    <td><input type="text" name="txtCurrentSuburb" size="20" maxlength="50" onblur="changeCase(this)" onchange="remove_XS_whitespace(this)"></td>
   </tr>

   <tr>
    <td>State: <img src="images/required.gif" alt="required field" /></td>
    <td><select size="1" name="txtCurrentState">
    	<OPTION value="VIC" selected>VIC</option>
    	<OPTION value="NSW">NSW</option>
    	<OPTION value="QLD">QLD</option>
    	<OPTION value="ACT">ACT</option>
    	<OPTION value="NT">NT</option>
    	<OPTION value="WA">WA</option>
    	<OPTION value="SA">SA</option>
    	<OPTION value="TAS">TAS</option>

      </select></td>
    <td>Post Code: <img src="images/required.gif" alt="required field" /></td>
    <td><input type="text" name="txtCurrentPostCode" size="8" maxlength="8" onchange="null_number(this); return checkban(this);" onblur="remove_XS_whitespace(this)"> Numbers only</td>
  </tr>

  <tr>
    <td>Phone Number:</td>
    <td><input type="text" name="txtPhone" size="8" value="0" maxlength="30"  onblur="remove_XS_whitespace(this)"></td>
    <td>Mobile Number:</td>
    <td><input type="text" name="txtMobile" size="10" value="0" maxlength="30"  onblur="remove_XS_whitespace(this)"></td>
  </tr>

  <tr>
  	<td >Date Of Birth:</td>
    <td><input type="text" name="txtDateOfBirth" size="10" maxlength="10" onKeyUp="DateFormat(this,this.value,event,false,'3')" onBlur="DateFormat(this,this.value,event,true,'3');DatePosition(this.value,2)"> DD/MM/YYYY or empty</td>
    <td ><span lang="en-au">Gender: </span></td>
    <td><input type="radio" value="Male" name="optGender" checked>Male<input type="radio" value="Female" name="optGender">Female</td>

  </tr>


  <tr>
  	<td ><span lang="en-au"> Adults Assisted: <img src="images/required.gif" alt="required field" /></span>
    </td>
    <td ><input type="text" name="txtAdults" value="0" size="2" maxlength="2" onchange="null_number(this); return checkban(this)" onblur="remove_XS_whitespace(this)"></td>
    <td ><span lang="en-au">Children Assisted: <img src="images/required.gif" alt="required field" /></span>
    </td>
    <td ><input type="text" name="txtChildren" value="0" size="2" maxlength="2" onchange="null_number(this); return checkban(this)" onblur="remove_XS_whitespace(this)"></td>

  </tr>

  <tr>
    <td><input type="hidden" name="txtCentreLinkAmount" size="9" value="0" onchange="return checkbandollar(this)" onblur="remove_XS_whitespace(this)"></td>
  </tr>
  </TABLE>

<hr>

<h3>Assistance Provided</h3>
<TABLE width="100%" cellpadding="5" cellspacing="0" border="0">
	<tr>
    <td>ER Given: </td>
    <td>
	    <input type="radio" value="Y" name="optErGiven" checked  onfocus="enableassistance('form','payment[]')">Yes
			<input type="radio" value="N" name="optErGiven"   onfocus="disableassistance('form','payment[]')"   on>No
		</td>
  </tr>

<?
    //=================================PAYMENTS ON VISIT======================
				echo "<tr>";

				echo "<td>I referred this client internally&nbsp;<img src=\"images/required.gif\" alt=\"required field\" /></td>";
				echo "<td><input type=\"radio\" value=\"Yes\" name=\"referred_internal\">Yes&nbsp;&nbsp;&nbsp;";
				echo "<input type=\"radio\" value=\"No\" name=\"referred_internal\">No<br /></td>";
				echo "<tr></tr>";

				echo "<td>I referred this client externally&nbsp;<img src=\"images/required.gif\" alt=\"required field\" /></td>";
				echo "<td><input type=\"radio\" value=\"Yes\" name=\"referred_external\">Yes&nbsp;&nbsp;&nbsp;";
				echo "<input type=\"radio\" value=\"No\" name=\"referred_external\">No<br /></td>";
				echo "<tr></tr>";

				echo "</tr>";

    //echo "<table border=\"0\">\n";
    $payments = get_labels_addvisit("er_payment");
    foreach ($payments as $value)
	{
    	echo "<tr>\n";
    	echo "<td>$value->payment_type:</td>";
    	echo "<td><input type=\"textbox\" name=\"payment$value->payment_id\" value=\"0.00\" size=\"6\" maxlength=\"6\" onblur=\"this.value = convertcurrentcy1(this.value);\">";
    	if($value->payment_type=="Other")
    	{
    		echo "<tr>\n";
    		echo "<td >Other Payment Type:</td>";
    		echo "<td ><input type=\"text\" name=\"txtOtherPaymentType\" size=\"20\" maxlength=\"30\" ></td>";
    		echo "<tr>\n";
    		echo "<td >Extra Food Parcels:</td>";
    		echo "<td ><input type=\"textbox\" name=\"extraFoodParcels\" value=\"0.00\" size=\"6\" maxlength=\"6\" onblur=\"this.value = convertcurrentcy1(this.value);\">";
    		echo "</td>";
    	}
    }


    echo "<tr>";
    echo "<td>Cheque Payee (for cheques only):</td>";
    echo "<td><input type=\"textbox\" name=\"txtChequePayee\" maxlength=\"20\" onchange=\"remove_XS_whitespace(this);chequenumber(this)\" onblur=\"remove_XS_whitespace(this)\"></td>";
    echo "<td>Cheque No:</td>";
    echo "<td><input type=\"textbox\" name=\"txtErAmountRecieptNo\" maxlength=\"10\" size=\"10\" value=\"\" onchange=\"return checkban(this)\" onblur=\"checkvalue(this)\" > Numbers only</td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Reason for Cheque Payment:</td>";
    echo "<td><input type=\"textbox\" name=\"txtReasonChequePayment\" maxlength=\"30\" onblur=\"remove_XS_whitespace(this)\"  onchange=\"return checkpayee(this)\" >";
    echo "</tr>";


 ?>
</TABLE>


<hr>
 <tr><td><h3>Sources of Household Incomes</h3></TD></tr>
<?
//=========================CLIENT INCOMES===============================
$incomes = get_labels("er_income_source");
make_checkbox_html($incomes, 3, 400, "incomes[]", "amount[]","whenDue[]");

function make_checkbox_html($arr, $num, $width, $name,$name1,$name2)
{
	echo  "";
	echo  "<TABLE cellpadding=\"5\" cellspacing=\"0\" border=\"0\">\n";
	echo "<tr>\n";

	echo "<td style=\"text-align: center; vertical-align:top;\">Income Type</td>";
	echo "<td style=\"text-align: center; vertical-align:top;\">Amount Per Fortnight </td>";
	echo  "<td style=\"text-align: center; vertical-align:top;\">Due</td>";

	for($i=1;$i<=3;$i++)
	{
		echo  "<tr>";
		echo "<td style=\"text-align: center; vertical-align:top;\">";
		echo "<select name=$name>";
		echo "<option>Select Client Income</option>";
		//echo  populateDropDownListBoxes("er_income_source",1, "income_type");
		$query="SELECT * FROM er_income_source ORDER BY income_type" ;

		$results=r_db($query);



		while ($row=mysql_fetch_array($results))

		{
			if ($row[1]!="Other" && $row[1]!="Select Client Income")
			echo "<option>$row[1]</option>";

		}
		echo "<option>Other</option>";
		echo "</select>";
		echo  "</td>";
		echo  "<td style=\"text-align: center; vertical-align:top;\"><input type=\"text\" name=\"$name1\" size=\"10\" maxlength=\"10\" value=\"0.00\" onblur=\"this.value = convertcurrentcy1(this.value);\"></td>\n";
		echo  "<td style=\"text-align: center; vertical-align:top;\"><input type=\"text\" name=\"$name2\" size='10' maxlength=\"10\" onKeyUp=\"DateFormat(this,this.value,event,false,'3')\" onBlur=\"DateFormat(this,this.value,event,true,'3')\" onchange=\"DateFormat(this,this.value,event,true,'3'); DatePosition(this.value,3);\"></td>\n";
		echo "</tr>";
	}
	echo "<tr><td colspan=\"3\">If income type is duplicated only the first duplicate is saved.</td></tr>";
	echo "<td>Other Income Type:</td>";
	echo "<td colspan=\"2\"><input type=\"textbox\" name=\"txtOtherIncomeSourceType\" maxlength=\"50\" size=\"20\">";


	echo  "</table>\n";

}

//===============================================================================
?>


<TABLE width="100%" cellpadding="5" cellspacing="0" border="0">
 <tr>

     <!--
<td height="37">Visit Recorded Date(dd/mm/yyyy)</td>
-->
<?  $recordeddate=date("Y-m-d");
	echo"<td ><input type=\"hidden\" name=\"txtVisitRecordedDate\"  value=\"$recordeddate\" maxlength=\"10\"  onKeyUp=\"DateFormat(this,this.value,event,false,'3')\" onBlur=\"DateFormat(this,this.value,event,true,'3')\">" ; ?>
    </td>
  </tr>
  <!--
onFocus="vDateType='3'"
-->
  <hr>
<tr>
    <td ><span lang="en-au">Income Status:</span></td>
    <td  ><select size="1" name="cmbIncomeStatus" onchange="otherincomestatus(this)">
    <?
	populateDropDownListBoxes("er_income_status",1, "income_status_type");
    ?>
      </select></td>
    <td >Other Income Status:</td>
    <td ><input type="text"  name="txtOtherIncomeStatusType" size="20" maxlength="50" onchange="remove_XS_whitespace(this);return changeCase(this)" onblur="otherincomestatusnull(this)">
      </td>
  </tr>
  <tr>
    <td >Housing Type:</td>
    <td  ><span lang="en-au"></span><select size="1" name="cmbHousingType" onchange="otherhousingtype(this)">
    <?
	populateDropDownListBoxes("er_housing_type",1, "housing_type");
	?>
      </select>
    </td>
    <td >Other Housing Type:</td>
    <td ><input type="text"  name="txtOtherHousingType" size="20" maxlength="50" onchange="remove_XS_whitespace(this);return changeCase(this)" onblur="otherhousingtypenull(this)">
      </td>
  </tr>
  <tr>
<!--
onblur="return checkbandollar(this)"
-->
    <td>Rent Paid Per Fortnight($):</td>
	<td ><input type="text" value="0.00" name="txtFortnightlyPayments" size="7" maxlength="7"  onblur="this.value = convertcurrentcy1(this.value);"></td>

  </tr>
  <!--
onblur="parseelement(this)"
-->

  <tr>
    <td >Client Referred By:</td>
    <td  colspan="4" ><span lang="en-au"></span><select size="1" name="cmbAgency">
    <?
populateDropDownListBoxes("er_agency",1, "agency_name");
	?>
      </select>
    </td>
  </tr>
  </TABLE>

  <?
/* get the checkbox labels */
//$skills = get_checkbox_labels("const_skills");
$emergencyReliefs = get_labels_er("er_emergency_relief");

/* create the html code for a formatted set of
checkboxes */
$html_incomes = make_er_checkbox_html($emergencyReliefs, 4, 600, "emergencyReliefs[]");

?>
<hr>
<p align="left"><u><h3>Reason for seeking assistance <img src="images/required.gif" alt="required field" /></P></u></h3>
   <?
   //==================================EMERGENCY RELIEFS===========================
   echo "<TABLE width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\">\n";

   echo "$html_incomes";
   echo "</table>\n";
   function make_er_checkbox_html($arr, $num, $width, $name)
   {
   	$closingTR = false;
   	$str = "";
   	$str .= "<tr>\n";
   	if (count($arr) % $num != 0)
   	{
   		$closingTR = true;
   	}

   	$i=1;

   	foreach ($arr as $ele)
   	{
   		$str .= "<td><input type=\"checkbox\" name=\"$name\" value=\"$ele->er_id\">";
   		$str .= "$ele->er_reason\n</td>";//prints PHP, perl,...
   		if($ele->er_reason=="Other")
   		{
   			//$str .= "<td>	</td>";
   			$str .= "<td>Other Reason:</td>";
   			$str .= "<td><input type=\"text\" name=\"txtOtherEr\" size=\"20\" maxlength=\"50\"></td>";
   		}
   		//$str .= "</tr>";
   		if ($i % $num == 0)
   		{
   			$str .= "</tr>\n<tr>";
   		}
   		else
   		{
   			$str .= "</td>\n";
   		}
   		$i++;
   	}


   	return $str;
   }
?>
<hr>
<P></P>



<p align="left"><u><h3>Action taken Associated with E.R. <img src="images/required.gif" alt="required field" /></P></u></h3>

  <?	//==================================ACTION TAKEN===========================
  /* get the checkbox labels */


  $actionTaken = get_labels_actionTaken("er_action_taken");

  /* create the html code for a formatted set of
  checkboxes */

  $html_action = make_action_checkbox_html($actionTaken, 3, "actionTaken[]");

  ?>

  <p align="left"><u><h3></P></u></h3>
     <?

        echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">\n";

        echo "$html_action";
        echo "</table>\n";
        function make_action_checkbox_html($arr, $num, $name)
        {
        	$closingTR = false;
        	$str = "";
        	$str .= "<tr>\n";
        	if (count($arr) % $num != 0)
        	{
        		$closingTR = true;
        	}

        	$i=1;

        	foreach ($arr as $ele)
        	{
        		$str .= "<td><input type=\"checkbox\" name=\"$name\" value=\"$ele->action_id\">";
        		$str .= "$ele->action_taken\n</td>";
        		if($ele->action_taken=="Other")
        		{
        			$str .= "<td>Other Reason (financial only):</td>";
        			$str .= "<td><input type=\"text\" name=\"txtActionOther\" size=\"20\" maxlength=\"50\"></td>";
        		}

        		if($ele->action_taken=="Discussed Return Date(if no entitlement or not eligible)")
        		{
        			$str .= "<td>Return date:</td>";
        			$str .= "<td><input type=\"text\" name=\"txtReturnDate\" size=\"20\" maxlength=\"50\"></td>";
        		}
        		//$str .= "</tr>";
        		if ($i % $num == 0)
        		{
        			$str .= "</tr>\n<tr>";
        		}
        		else
        		{
        			$str .= "</td>\n";
        		}
        		$i++;
        	}


        	return $str;
        }
  ?>

<table>
<tr>
<td>&nbsp;</td>
</tr>




<tr>
<td><span lang="en-au">Client Signature: </span>
</td>
<td><input type="radio" value="Y" name="optClientSignature" checked>Yes
<input type="radio" value="N" name="optClientSignature">No</td>
</tr>


<tr>
<td >Interviewer: <img src="images/required.gif" alt="required field" /></td>
<td colspan="4"><input type="text" name="txtInterviewer" size="20" maxlength="50" onblur="changeCase(this)" onchange="remove_XS_whitespace(this)"></td>
</tr>

</table>

<hr>

<TABLE width="100%">

<tr>

<td align="center"><input type="button" style="width:200px;" value="Save" onclick="verify();" name="btnSaveForm"></td>

</tr>

</TABLE>

</form>

</html>